#!/usr/bin/env python

import wx

import resource as r
import __groups as groups

class Groups(wx.Panel):
    '''Groups class
    
    @author Julot <andy.julot@gmail.com>
    @since Monday, February 27, 2012. 03:43 PM'''
    
    def __init__(self, parent):
        super(Groups, self).__init__(parent)
        
        label = '%s:' % r.string.view.groups.group
        text = wx.StaticText(self, label=label)
        self.group = groups.Group(self)
        
        sizerGroup = wx.BoxSizer(wx.HORIZONTAL)
        sizerGroup.Add(text, 0, flag=wx.ALIGN_CENTER_VERTICAL)
        sizerGroup.AddSpacer(r.dimen.spacer)
        sizerGroup.Add(self.group, 1, wx.GROW)
        
        self.splitter = wx.SplitterWindow(self, style=wx.SP_LIVE_UPDATE)
        
        label = r.string.view.groups.members
        self.members = groups.Contacts(self.splitter, label)
        label = r.string.view.groups.availableContacts
        self.contacts = groups.Contacts(self.splitter, label)
        
        self.splitter.SplitVertically(self.members, self.contacts)
        self.splitter.SetMinimumPaneSize(100)
        
        sizer = wx.BoxSizer(wx.VERTICAL)
        
        sizer.Add(sizerGroup, 0, wx.GROW)
        sizer.AddSpacer(2)
        sizer.Add(self.splitter, 1, wx.GROW)
        
        self.SetSizer(sizer)